
<!--
   弹窗组件，基于mintUI的messageBox
-->
<template>
    <div></div>
</template>
<script>

import '../messageBox.less';
import { MessageBox } from 'mint-ui';

export default {
    name: 'messageBox',
    props: ["customerId","customerName","scheduleType","custSource","money","businessId","scheduleTime"],
    data() {
        return {
            isSaveClick: true,
        }

    },
    methods: {

        //打开弹窗
        open(obj) {
            MessageBox.confirm('', {
                message: '确定将此条到期资金添加到日程？',
                title: '提示',
            }).then(action => {
                if (action == 'confirm') {     //确认的回调
                    console.log(1);
                    if(!this.isSaveClick)return
                    this.$axiosHttp.http({
                            method: "POST",
                            url: apiUrl.addScheduleApi,
                            params: {
                                customerId: this.customerId,
                                customerName:this.customerName,
                                scheduleType:this.scheduleType,
                                scheduleTime:this.scheduleTime,
                                custSource:this.custSource,
                                money:this.money,
                                businessId:this.businessId,
                            }
                        }, (res) => {
                            console.log('进入成sdfsaf功')
                            this.isSaveClick = false;
                            this.$emit("fundsFlag", 1);
                        }, (res) => {
                            this.$toast(res.data.message)
                            this.isSaveClick = false;
                        },
                        (res) => {
                            console.log('jin', res)
                            this.isSaveClick = false;
                        })
                }
            }).catch(err => {
                if (err == 'cancel') {     //取消的回调
                    console.log(2);
                }
            });
        },

    }
}
</script>

